package xiyuan.localio;

import java.io.File;
import java.io.IOException;
import java.util.List;

import xiyuan.weibo.UserInfo;

import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;

public class UserInfoReader {
	public static void main(String[] agrs){
		readByURL("user.json");
	}
	public static int readByURL(String url){
		ObjectMapper mapper = new ObjectMapper();
		List list = null;
		try {
			list = mapper.readValue(new File(url), List.class);
		} catch (JsonParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (JsonMappingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		for (Object obj: list){
			UserInfo user = (UserInfo) obj;
			
		}
		return 0;
	}
}
